package com.niiwoo.civet.trade.enums.kaola;

/**
 * Created by wangjichao on 2017/9/1.
 */
public enum KaoLaLiCaiReceiveEnum {
    NOTIFY_CONTRACT(1, "notify_contract", "借款合同回调", "kaoLaLiCaiNotifyContractService"),
    NOTIFY_LOAN(2, "notify_loan", "放款回调", "kaoLaLiCaiNotifyLoanService"),
    NOTIFY_REPAYMENT(3, "notify_repayment", "还款回调", "kaoLaLiCaiNotifyRepaymentService");

    private Integer methodId;
    private String path;
    private String desc;
    private String serviceBeanName;

    public Integer getMethodId() {
        return methodId;
    }

    public void setMethodId(Integer methodId) {
        this.methodId = methodId;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getServiceBeanName() {
        return serviceBeanName;
    }

    public void setServiceBeanName(String serviceBeanName) {
        this.serviceBeanName = serviceBeanName;
    }

    KaoLaLiCaiReceiveEnum(Integer methodId, String path, String desc, String serviceBeanName) {
        this.methodId = methodId;
        this.path = path;
        this.desc = desc;
        this.serviceBeanName = serviceBeanName;
    }


    public static KaoLaLiCaiReceiveEnum getEnumByPath(String path) {
        for (KaoLaLiCaiReceiveEnum kaoLaLiCaiReceiveEnum : KaoLaLiCaiReceiveEnum.values()) {
            if (kaoLaLiCaiReceiveEnum.getPath().equals(path)) {
                return kaoLaLiCaiReceiveEnum;
            }
        }
        return null;
    }
}